package com.bigzero.workflow.common.config;

import com.bigzero.workflow.common.service.impl.UserDetailsServiceImpl;
import com.bigzero.workflow.modules.system.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * Activiti7配置文件
 * @author fanxinxiong
 * @date 2025-02-13 11:09
 */
@Configuration
public class Activiti7Config {

    @Resource
    private UserService userService;

    @Bean
    public UserDetailsService activitiUserDetailsService() {
        return new UserDetailsServiceImpl(userService);
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
